// 只要有返回值就重复调用
module.exports = class SyncBailHook {
    constructor() {
        this.tasks = []
    }
    tap(name, callback) {
        this.tasks.push(callback);
    }
    call(...args) {
        let res
        this.tasks.forEach(fn => {
            do {
                res = fn(...args)
            } while (res !== undefined)
        })
    }
}